package org.flexspeedup.blog.events
{
import flash.events.Event;
/**
 * Closes the currently open pop up
 */
public class ClosePopUpEvent extends Event
{
    //--------------------------------------------------------------------------
    //
    //  Class Properties
    //
    //--------------------------------------------------------------------------

    //--------------------------
    // ID
    //--------------------------
    /**
     * Unique id for this event.
     */
    public static const ID:String = "ClosePopUpEvent";
    
    //--------------------------------------------------------------------------
    //
    // Constructor
    //
    //--------------------------------------------------------------------------

    /**
     * Creates a new instance of the <code>ClosePopUpEvent</code> event 
     */    
    public function ClosePopUpEvent(nextEvent:Event = null, 
                                           removePendingChanges:Boolean = false)
    {
        super(ID, true, true);
        _nextEvent = nextEvent;
        _removePendingChanges = removePendingChanges;
    }

    //--------------------------------------------------------------------------
    //
    //  Properties
    //
    //--------------------------------------------------------------------------

    //----------------------------------
    //  removePendingChanges
    //----------------------------------

    /**
     *  @private
     */
    private var _removePendingChanges:Boolean;

    /**
     * If true, clears the pending changes flag
     */
    public function get removePendingChanges():Boolean
    {
        return _removePendingChanges;
    }
    
    //----------------------------------
    //  nextEvent
    //----------------------------------

    /**
     *  @private
     */
    private var _nextEvent:Event;

    /**
     * The event to dispatch when closing the pop up
     */
    public function get nextEvent():Event
    {
        return _nextEvent;
    }
    
    //--------------------------------------------------------------------------
    //
    //  Overridden Methods - Event
    //
    //--------------------------------------------------------------------------

    /**
     * @inheritdoc flash.events.Event#clone
     */
    override public function clone():Event
    {
        return new ClosePopUpEvent(nextEvent, removePendingChanges);
    }
}
}